<?php
	include ("./System/Kernel/functions.php");
	include ("./System/Security/settings.php");
	
	$error = 0;
	
	if(!file_exists("./System/Kernel/folders.boot")){
		echo "ERROR: ./System/Kernel/folders.boot not found.<br />";
		$error++;
	}
	
	if(file_exists("./System/Kernel/folders.boot") and substr(decoct(fileperms("./System/Kernel/folders.boot")),1) < "00644"){
		echo "ERROR: ./System/Kernel/folders.boot not 0664. Check CHMOD Permissions. (".substr(decoct(fileperms("./System/Kernel/folders.boot")),1).")<br />";
		$error++;
	}
	
	if (version_compare(PHP_VERSION, '5.2.0') != 1){
		echo "ERROR: PHP Version is lower than 5.2.0. Update. (".PHP_VERSION.")<br />";
		$error++; 	
	}
	
	if(!function_exists("sqlite_open")){
		echo "ERROR: Cannot perform SQLITE functions. SQLITE library should be installed with PHP 5.2.0.<br />";
		$error++;
	}
	
	if($error > 0){
		exit();
	}
	
	if (ALLOW_EASY_MOVE == true){
		build_foldersDB();
	}
	header("Location: main.php");
?>